]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dash: Allow adding favorites out of favorites zone
authorBryan Dunsmore <bryan.dunsmore@outlook.com>
Wed, 13 May 2020 16:28:53 +0000 (11:28 -0500)
committerFlorian Müllner <florian.muellner@gmail.com>
Thu, 14 May 2020 18:32:57 +0000 (18:32 +0000)
Previously, you could not add favorites outside of the favorites zone.
This change inserts a placeholder at the end of the favorites zone if
you are outside of it.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2777

js/ui/dash.js

index 6eb71e73bd7394ab9f06c3484f036d6849c1dcee..60725381b3794e9cd860a430bb0d1c9959d0c195 100644 (file)
@@ -815,7 +815,12 @@ var Dash = GObject.registerClass({
         else
             pos = 0; // always insert at the top when dash is empty
 
-        if (pos != this._dragPlaceholderPos && pos <= numFavorites && this._animatingPlaceholdersCount == 0) {
+        // Put the placeholder after the last favorite if we are not
+        // in the favorites zone
+        if (pos > numFavorites)
+            pos = numFavorites;
+
+        if (pos !== this._dragPlaceholderPos && this._animatingPlaceholdersCount === 0) {
             this._dragPlaceholderPos = pos;
 
             // Don't allow positioning before or after self
@@ -843,11 +848,6 @@ var Dash = GObject.registerClass({
             this._dragPlaceholder.show(fadeIn);
         }
 
-        // Remove the drag placeholder if we are not in the
-        // "favorites zone"
-        if (pos > numFavorites)
-            this._clearDragPlaceholder();
-
         if (!this._dragPlaceholder)
             return DND.DragMotionResult.NO_DROP;